package com.tbit.uqbike.webmanager.controller;

import com.tbit.uqbike.object.pojo.vo.ReturnBikeMsgStatVO;
import com.tbit.uqbike.object.pojo.vo.ReturnBikeStatVO;
import com.tbit.common.entity.view.Result;
import com.tbit.uqbike.service.business.ReturnBikeStatService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 还车统计
 *
 * @AUTHOR: wei.xing
 * @DATE: 2023-05-17 15:52
 **/
@RestController
@RequestMapping("/returnBikeStat")
public class ReturnBikeStatController {


    @Resource
    private ReturnBikeStatService returnBikeStatService;

    /**
     * 无法还车统计
     *
     * @param accountId
     * @param startTime
     * @param endTime
     * @return
     */
    @RequestMapping("/getNoReturnBikeStat")
    public Result getNoReturnBikeStat(Integer brandId, Integer accountId, Long startTime, Long endTime) {
        List<ReturnBikeStatVO> list = returnBikeStatService.getNoReturnBikeStat(brandId, accountId, startTime, endTime);
        return Result.success(list);
    }


    /**
     * 站点还车判断方式统计
     *
     * @param accountId
     * @param startTime
     * @param endTime
     * @return
     */
    @RequestMapping("/getReturnBikeMsgStat")
    public Result getReturnBikeMsgStat(Integer brandId, Integer accountId, Long startTime, Long endTime) {
        ReturnBikeMsgStatVO stat = returnBikeStatService.getReturnBikeMsgStat(brandId, accountId, startTime, endTime);
        return Result.success(stat);
    }

}
